package ru.urfc.portal.ui.client.widgets;

import ru.urfc.portal.ui.client.Constants;
import ru.urfc.portal.ui.client.controllers.ItemsController;
import ru.urfc.portal.ui.client.descriptor.GridDescriptor;

import com.extjs.gxt.ui.client.data.BaseModelData;
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.ui.Composite;

public abstract class BaseFilter extends Composite implements Constants {
	
	protected GridDescriptor descriptor = new GridDescriptor("");
	protected ItemsController itemsController = new ItemsController(descriptor);
	
	public void addParameters(BaseModelData config) {
		itemsController.prepareFilter(config);
	}

	public void setupButton(Element button) {
		getPlaceForSearchButton().appendChild(button);
	}

	protected abstract Element getPlaceForSearchButton();

}
